######Dan Hopkins and Grace Kim
######Immigration Code 
######jxnit matrix
######August 10 2007

# condor_submit_util -i immigfinal083107.R  -f -n 1
library(e1071)
library(VA)
library(ReadMe)

underg <- undergrad(control="/nfs/fs1/projects/poliblog/replication/immig/controlimmig.txt",sep=",")

### input full frequencies
source("/nfs/fs1/projects/poliblog/replication/undergrad2.R")
undergff <- undergrad2(control="/nfs/fs1/projects/poliblog/replication/immig/controlimmig.txt",sep=",")

underg2 <- preprocess(underg)
underg2$trainingset$TRUTH[underg2$trainingset$TRUTH==3] <- 1
underg2$testset$TRUTH[underg2$testset$TRUTH==3] <- 1
fea <- 9
rout <- readme(underg2,n.subset=500,features=fea,boot.se=T,printit=F)
save(rout,file="/nfs/fs1/projects/poliblog/replication/immig/immigfinal033108C.Rdata")
